<?php

function phpbb2_create_user(){
	$pieces = explode(";", registerdetails);
	$username = $pieces[0]; 
	$password = $pieces[1]; 
	$email = $pieces[2]; 
	$return = $pieces[3]; 
	
	echo 'http://localhost/pligg/modules/phpbb2/create_user.php?username='.$username.'&password='.$password.'&email=' . $email . '&return=' . getmyurl('user', $username);
	//header('Location: http://localhost/pligg2/modules/phpbb2/create_user.php?username='.$username.'&password='.$password.'&email=' . $email . '&return=' . getmyurl('user', $username));
	die();
}

function phpbb2_login(){
	global $current_user;

	include_once(mnminclude.'user.php');
	
	$pieces = explode(";", logindetails);
	$username = $pieces[0]; 
	$password = $pieces[1]; 
	$return = $pieces[2]; 

	$login=$current_user->user_login;
	$user=new User();
	$user->username = $login;
	if(!$user->read()) {
		echo "error 2";
		die;
	}
	$password = md5($password);
	$email = $user->email;
	//echo 'Location: http://localhost/pligg2/modules/phpbb2/login.php?username='.$username.'&password='.$password.'&email='.$email.'&return=' . $return;
	header('Location: http://localhost/pligg/modules/phpbb2/login.php?username='.$username.'&password='.$password.'&email='.$email.'&return=' . $return);
	die();
}	

function phpbb2_logout(){
	//echo '<a href="http://localhost/pligg2/modules/phpbb2/logout.php?return=' . wheretoreturn . '">continue</a>';
	header('Location: http://localhost/pligg/modules/phpbb2/logout.php?return=' . wheretoreturn);
	die();
}


?>